package com.atguigu.gmall.publisher.mapper;

import com.atguigu.gmall.publisher.bean.TrafficVisitorStatsPerHour;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TrafficVisitorStatsMapper {
    // 分时流量数据查询
    @Select("select\n" +
            "toHour(stt) hr,\n" +
            "sum(isUnique)  uv_ct,\n" +
            "sum(pagesCount)  pv_ct,\n" +
            "sum(sidCount) durSum\n" +
            "from dws_page_and_unique_count\n" +
            "where toYYYYMMDD(stt) = #{date}\n" +
            "group by hr")
    List<TrafficVisitorStatsPerHour> selectVisitorStatsPerHr(Integer date);
}
